{extend name="public:base"/}
{block name="main"}

<form class="layui-form" action="" method="POST">
        <div class="layui-form-item">
          <label class="layui-form-label">修改密码</label>
          <div class="layui-input-inline" style="width:350px;">
         
            <input type="password" name="password" required lay-verify="required" placeholder="请输入新的密码" autocomplete="off" class="layui-input"  value="">
          </div>
          
        </div>
        
        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn" id="submit" type="button">立即提交</button>
          </div>
        </div>
</form> 

<script type="text/javascript">
	layui.use(['form','layedit','upload'], function(){
	  var form = layui.form;
  
    $("#submit").click(function(){
       var password=$("input[name='password']").val();
       if(password==''){
          alert("请输入新的密码");
       }else{
        
        $(this).attr("disabled",true);

        $.post(location.href,{"password":password},function(data){
          if(data==true){
            location.href="{:url('login/index')}";
          }else{
            alert("修改失败请重试~",'1');
          }
        });
       }
    })
    
	 
	  form.verify({
	    title: function(value){
	      if(value.length < 5){
	        return '图片地址至少得1个字符啊';
	      }
	    }
	    
	  });
    
	});
</script>
<script>
/*$(function () {
   
    var um = UM.getEditor('myEditors');
});*/
</script>

{/block}